package org.skatiger.jrove.component.foreach;

import java.util.Enumeration;
import java.util.Iterator;

public class EnumerationIterator extends ForeachStatusIteratorImpl {
    /**
     * 
     */
    private static final long serialVersionUID = -2125577464997703412L;

    public EnumerationIterator(Enumeration<?> e, Integer begin, Integer end,
            Integer step) {
        super(getEnumerationIterator(e), begin, end, step);
    }

    private static Iterator<?> getEnumerationIterator(Enumeration<?> e) {
        return new _EnumerationIterator(e);

    }

    private static class _EnumerationIterator implements Iterator<Object> {
        private Enumeration<?> _e;

        public _EnumerationIterator(Enumeration<?> e) {
            this._e = e;
        }

        public boolean hasNext() {
            return _e.hasMoreElements();
        }

        public Object next() {
            return _e.nextElement();
        }

        public void remove() {
            throw new UnsupportedOperationException("unsupported");
        }

    }
}
